Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Add extension support#7

Closed
nigoroll wants to merge 3 commits intovtest:mainfrom
nigoroll:ext
Closed

Add extension support#7
nigoroll wants to merge 3 commits intovtest:mainfrom
nigoroll:ext

Conversation

@nigoroll
Copy link
Copy Markdown
Contributor

This is the groundwork to add vtc commands at runtime, as required for making it possibly to use an externally packaged vtest in vinyl-cache.

The first commit adds dynamic registration of top level commands: Rather than using a constant array of commands, we maintain a dynamic array to which registered commands are appended.

The second commit adds the minimal dlopen() scaffolding to load extensions and adds a demo-extension called foo which adds a command by the same name.

Ref: varnishcache/varnish-cache#4398

@bsdphk
Copy link
Copy Markdown
Contributor

bsdphk commented Oct 21, 2025

Due to a misunderstanding, I was not aware of this PR when I started implementing the same basic idea.

However, this PR did also suffer from a number of problems, most importantly doing dlopen() before the fork() which protects the vtest-core against the tests going off the rails.

The committed version also has an autodiscovery facility, so users, in the normal case, will not have to think about proper -E arguments.

@bsdphk bsdphk closed this Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants